import 'package:flutter/material.dart';
import 'index_re_command_data.dart';
import 'index_re_command_item.dart';

//推荐内容整体布局
class IndexReCommand extends StatelessWidget {
  final List<IndexReCommandItem> dataList;

  const IndexReCommand({Key? key, this.dataList = indexReCommandData})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
        padding: const EdgeInsets.all(10.0),
        decoration: const BoxDecoration(color: Color(0x08000000)),
        child: Column(
          children: [
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween, //中间布局间距填满
              children: const <Widget>[
                Text(
                  "房屋推荐",
                  style: TextStyle(
                      color: Colors.black, fontWeight: FontWeight.w600),
                ),
                Text(
                  "更多",
                  style: TextStyle(color: Colors.black54),
                ),
              ],
            ),
            const Padding(padding: EdgeInsets.all(5)),
            Wrap(
                runSpacing: 10.0,
                spacing: 10.0,
                children: dataList.map((item) => IndexReCommandItemWidget(data: item,),).toList()
            )
          ],
        ));
  }
}
